Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve structured errors #50

Merged
merged 2 commits into from
May 13, 2024
Merged

Improve structured errors #50

merged 2 commits into from
May 13, 2024

Conversation

urschrei
Copy link
Member

This PR has a couple of minor changes from #48:

  1. Better error text for out-of-bounds coordinates
  2. DecodeCharError renamed to EncodeToCharError since that's what we're trying to do when the error occurs
  3. A new CoordEncodingError which is the "parent" of EncodeToCharError:

The reason for 3. is that we lack index or Coord information inside encode(). When an EncodeToCharError occurs there, we early-return back up to its calling encode_coordinates() parent function, where we do have index and Coord info, so we map the bare error onto the richer "parent".

This change has no perf implications in my testing.

Copy link
Member

@michaelkirk michaelkirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@urschrei urschrei added this pull request to the merge queue May 13, 2024
Merged via the queue into main with commit 694ca02 May 13, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants